<template>
	<view>
		<view class="page-section">
			 <scroll-view class="scroll-view_H" scroll-x="true" scroll-left="120">
				<view style="text-align: center;" v-for="item in dataList" :id="item.id" :key="item.id" class="swiper-item">{{item.title}}</view>
			</scroll-view>
		</view>
		<view class="banner" @click="goToVip">
			<view class="top">
				<view class="left">
					<image src="../../static/image/chushi.png" mode=""></image>
				</view>
				<view class="right">
					<view>
						<text>欢迎你，新朋友</text>
						<text>开通</text>
					</view>
					<text>8元开通VIP，畅学明初独家菜谱</text>
				</view>
			</view>
			<view class="bottom">
				<view>
					<view>
						<image src="../../static/image/kecheng.png" mode=""></image>
					</view>
					<text>名厨课程</text>
				</view><view>
					<view>
						<image src="../../static/image/noad.png" mode=""></image>
					</view>
					<text>无广告打扰</text>
				</view><view>
					<view>
						<image src="../../static/image/sfbs.png" mode=""></image>
					</view>
					<text>身份标识</text>
				</view>
			</view>
		</view>
		<view class="main">
			<view class="item">
				<text>vip最新推荐</text>
				<scroll-view class="scroll-view_H" scroll-x="true" @scroll="scroll" scroll-left="120">
					<view class="swiper-item">
						<image style="width: 300rpx;height: 200rpx;" src="../../static/image/liangf.png" mode=""></image>
						<text>\n</text>
						<text class="item-line" style="font-size: 25rpx;font-weight: bold;">川味凉粉</text>
						<view class="outer">
							<view>
								<text>12.3万</text>
								<image style="width: 40rpx;height:40rpx;" src="../../static/image/eys.png" mode=""></image>
							</view>
							<view>
								<text>5214</text>
								<image style="width: 40rpx;height:40rpx;margin-right: 50rpx;" src="../../static/image/xx.png" mode=""></image>
							</view>
						</view>
						<view class="ab-swiper">
							<image src="../../static/image/paly.png" mode=""></image>
							<text style="font-weight: bold;">04:05</text>
						</view>
					</view><view class="swiper-item">
						<image style="width: 300rpx;height: 200rpx;" src="../../static/image/liangf.png" mode=""></image>
						<text>\n</text>
						<text class="item-line" style="font-size: 25rpx;font-weight: bold;">川味凉粉</text>
						<view class="outer">
							<view>
								<text>12.3万</text>
								<image style="width: 40rpx;height:40rpx;" src="../../static/image/eys.png" mode=""></image>
							</view>
							<view>
								<text>5214</text>
								<image style="width: 40rpx;height:40rpx;margin-right: 50rpx;" src="../../static/image/xx.png" mode=""></image>
							</view>
						</view>
						<view class="ab-swiper">
							<image src="../../static/image/paly.png" mode=""></image>
							<text style="font-weight: bold;">04:05</text>
						</view>
					</view><view class="swiper-item">
						<image style="width: 300rpx;height: 200rpx;" src="../../static/image/liangf.png" mode=""></image>
						<text>\n</text>
						<text class="item-line" style="font-size: 25rpx;font-weight: bold;">川味凉粉</text>
						<view class="outer">
							<view>
								<text>12.3万</text>
								<image style="width: 40rpx;height:40rpx;" src="../../static/image/eys.png" mode=""></image>
							</view>
							<view>
								<text>5214</text>
								<image style="width: 40rpx;height:40rpx;margin-right: 50rpx;" src="../../static/image/xx.png" mode=""></image>
							</view>
						</view>
						<view class="ab-swiper">
							<image src="../../static/image/paly.png" mode=""></image>
							<text style="font-weight: bold;">04:05</text>
						</view>
					</view><view class="swiper-item">
						<image style="width: 300rpx;height: 200rpx;" src="../../static/image/liangf.png" mode=""></image>
						<text>\n</text>
						<text class="item-line" style="font-size: 25rpx;font-weight: bold;">川味凉粉</text>
						<view class="outer">
							<view>
								<text>12.3万</text>
								<image style="width: 40rpx;height:40rpx;" src="../../static/image/eys.png" mode=""></image>
							</view>
							<view>
								<text>5214</text>
								<image style="width: 40rpx;height:40rpx;margin-right: 50rpx;" src="../../static/image/xx.png" mode=""></image>
							</view>
						</view>
						<view class="ab-swiper">
							<image src="../../static/image/paly.png" mode=""></image>
							<text style="font-weight: bold;">04:05</text>
						</view>
					</view>
				</scroll-view>
			</view>
			<view class="item">
				<text>限时免费体验</text>
				<scroll-view class="scroll-view_H" scroll-x="true" @scroll="scroll" scroll-left="120">
					<view class="swiper-item">
						<image style="width: 300rpx;height: 200rpx;" src="../../static/image/liangf.png" mode=""></image>
						<text>\n</text>
						<text class="item-line" style="font-size: 25rpx;font-weight: bold;">川味凉粉</text>
						<view class="outer">
							<view>
								<text>12.3万</text>
								<image style="width: 40rpx;height:40rpx;" src="../../static/image/eys.png" mode=""></image>
							</view>
							<view>
								<text>5214</text>
								<image style="width: 40rpx;height:40rpx;margin-right: 50rpx;" src="../../static/image/xx.png" mode=""></image>
							</view>
						</view>
						<view class="ab-swiper">
							<image src="../../static/image/paly.png" mode=""></image>
							<text style="font-weight: bold;">04:05</text>
						</view>
					</view>
				</scroll-view>
			</view>
			<view class="item">
				<text>猜你喜欢</text>
				<view class="foot-xh">
					<view class="swiper-item">
						<image style="width: 340rpx;height: 200rpx;" src="../../static/image/liangf.png" mode=""></image>
						<text>\n</text>
						<text class="item-line" style="font-size: 25rpx;font-weight: bold;">川味凉粉</text>
						<view class="outer">
							<view>
								<text>12.3万</text>
								<image style="width: 40rpx;height:40rpx;" src="../../static/image/eys.png" mode=""></image>
							</view>
							<view>
								<text>5214</text>
								<image style="width: 40rpx;height:40rpx;margin-right: 50rpx;" src="../../static/image/xx.png" mode=""></image>
							</view>
						</view>
					</view><view class="swiper-item">
						<image style="width: 340rpx;height: 200rpx;" src="../../static/image/liangf.png" mode=""></image>
						<text>\n</text>
						<text class="item-line" style="font-size: 25rpx;font-weight: bold;">川味凉粉</text>
						<view class="outer">
							<view>
								<text>12.3万</text>
								<image style="width: 40rpx;height:40rpx;" src="../../static/image/eys.png" mode=""></image>
							</view>
							<view>
								<text>5214</text>
								<image style="width: 40rpx;height:40rpx;margin-right: 50rpx;" src="../../static/image/xx.png" mode=""></image>
							</view>
						</view>
					</view><view class="swiper-item">
						<image style="width: 340rpx;height: 200rpx;" src="../../static/image/liangf.png" mode=""></image>
						<text>\n</text>
						<text class="item-line" style="font-size: 25rpx;font-weight: bold;">川味凉粉</text>
						<view class="outer">
							<view>
								<text>12.3万</text>
								<image style="width: 40rpx;height:40rpx;" src="../../static/image/eys.png" mode=""></image>
							</view>
							<view>
								<text>5214</text>
								<image style="width: 40rpx;height:40rpx;margin-right: 50rpx;" src="../../static/image/xx.png" mode=""></image>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList:[
					{id:0,title:'推荐',done:true},
					{id:1,title:'免费体验',done:false},
					{id:2,title:'小白入门',done:false},
					{id:3,title:'快手菜',done:false},
					{id:4,title:'家常菜',done:false},
					{id:5,title:'面食',done:false},
					{id:6,title:'川湘菜',done:false},
					{id:7,title:'凉菜',done:false},
				],
				scrollTop: 0,
				old: {
					scrollTop: 0
				}
			}
		},
		methods: {
			scroll: function(e) {
				// console.log(e)
				this.old.scrollTop = e.detail.scrollTop
			},
			//点击开通会员
			goToVip(){
				uni.navigateTo({
					url:'../myVip/myVip'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
.page-section{
	height: 80rpx;
	width: 100%;
	background-color: #ee7b2d;
	font-size: 25rpx;
	border-top: .1rpx solid #ddd;
	.scroll-view_H{
		width: 100%;
		overflow: hidden;
		white-space: nowrap;
		color: #ffffff;
		.swiper-item{
			display: inline-block;
			width: 150rpx;
			margin-top: 25rpx;
		}
	}
}
.banner{
	height: 350rpx;
	width: 95%;
	background-color: #3b3d46;
	margin:  0 auto;
	margin-top: 15rpx;
	border-radius: 10rpx;
	.top{
		width: 100%;
		display: flex;
		align-items: center;
		box-sizing: border-box;
		padding: 25rpx;
		margin-bottom: 70rpx;
		.left{
			width: 20%;
			margin-right: 20rpx;
			image{
				width: 120rpx;
				height: 120rpx;
			}
		}
		.right{
			width: 80%;
			>view{
				display: flex;
				justify-content: space-between;
				margin-bottom: 10rpx;
				text:nth-of-type(1){
					color: #ccc;
					font-size: 20rpx;
				}
				text:nth-of-type(2){
					color: #555555;
					font-size: 18rpx;
					padding:5rpx 30rpx;
					border-radius: 20rpx;
					background-color: #e7b99a;
					margin-right: 78rpx;
				}
			}
			>text{
				color: #ddd;
				font-size: 27rpx;
				font-weight: bold;
			}
		}
	}
	.bottom{
		font-size: 20rpx;
		display: flex;
		justify-content: space-between;
		box-sizing: border-box;
		padding: 10rpx 60rpx;
		background-color: #242425;
		height: 100rpx;
		>view{
			>view{
				width: 40rpx;
				height: 40rpx;
				background-color: #e7b99a;
				border-radius: 50%;
				margin: 0 auto;
				margin-bottom: 15rpx;
				image{
					padding: 10rpx;
					width: 20rpx;
					height: 20rpx;
				}
			}
			text{
				color: #e7b99a;
			}
		}
	}
}
.main{
	width: 100%;
	box-sizing: border-box;
	padding: 20rpx;
	.item{
		margin-bottom: 20rpx;
		.scroll-view_H{
			width: 100%;
			overflow: hidden;
			white-space: nowrap;
			color: #ffffff;
			.swiper-item{
				display: inline-block;
				width: 320rpx;
				margin-top: 25rpx;
				position: relative;
				>image{
					border-radius: 10rpx;
				}
				.item-line{
					color: #333333 !important;
				}
				.outer{
					font-size: 20rpx;
					color: #ccc;
					display: flex;
					justify-content: space-between;
					>view{
						display: flex;
						align-items: center;
					}
				}
				.ab-swiper{
					width: 62rpx;
					position: absolute;
					right: 40rpx;
					bottom: 100rpx;
					>image{
						width: 18rpx;
						height: 18rpx;
						vertical-align: middle;
					}
					>text{
						font-size: 16rpx;
						vertical-align: middle;
					}
				}
			}
		}
		.foot-xh{
			display: flex;
			justify-content: space-between;
			flex-wrap: wrap;
			.swiper-item{
				display: inline-block;
				width: 350rpx;
				margin-top: 25rpx;
				position: relative;
				>image{
					border-radius: 10rpx;
				}
				.item-line{
					color: #333333 !important;
				}
				.outer{
					font-size: 20rpx;
					display: flex;
					color: #ccc;
					justify-content: space-between;
					>view{
						display: flex;
						align-items: center;
					}
				}
			}	
		}
	}
}
</style>
